<div class="row"> 
<div class="span12">
<div id="<*$controller*>"> 
<div class="clearfix txtleft search" style="background-color:#f8f8f8; padding:10px; margin:10px 0px;"> 
      <form action="/<*$controller*>/student" method="get" class="form-horizontal" name="form1">       
		  机构:<select id="jigou" name="groups"  onchange="getSchool(this.value)"></select>
          校园:<select id="school" name="school"  onchange="getClass(this.value)"></select> 
          班级:<select id="class1" name="class" ></select>  
         <input type="submit" class="btn btn-success"  value="查询"  >
         <input type="button" class="btn btn-success" value="清空查询" onclick="window.location='/<*$controller*>/<*$action*>'" >  
      </form> 
   
	</div> 
    </div>
</div>
</div> 
<script type="text/javascript" src="/js/prototype.js"></script>
<script type="text/javascript"> 

  window.onload=function(){
	 jigou(); 

	if('<*$groups*>' != ''){
		getSchool('<*$groups*>');
	}
	if('<*$school_id*>' != ''){
		getClass('<*$school_id*>');
	}

 } 
function jigou()
{  

	var url     = '/<*$controller*>/groups/'; 
	//var pars = '&classname=' + classname +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason;
	var pars = '';
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_course});

} 
function showResponse_course(originalRequest)
{
	{  //alert(originalRequest.responseText);  
		 document.all.form1.groups.innerHTML='<option value="0" >==请选择==</option>'+originalRequest.responseText;
		  if('<*$groups*>' != ''){
			 jsSelectIsExitItem(document.all.form1.groups,'<*$groups*>');
	        } 
	 }

}  

function getSchool(a)
{  
	var url  = '/<*$controller*>/schoollist/'; 
	//var pars = '&classname=' + classname +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason;
	var pars = '&id=' + a;
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_school});

} 
function showResponse_school(originalRequest)
{
	{    //alert(originalRequest.responseText);  
		 document.all.form1.school.innerHTML='<option value="0" >==请选择==</option>'+originalRequest.responseText;
		  if('<*$school_id*>' != ''){
				jsSelectIsExitItem(document.all.form1.school,'<*$school_id*>');
			}
	 } 
}  
function getClass(a)
{  
     
	var url  = '/<*$controller*>/classlist/'; 
	//var pars = '&classname=' + classname +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason;
	var pars = '&id=' + a;
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_class});

} 
function showResponse_class(originalRequest)
{
	{    //alert(originalRequest.responseText);  
		 document.all.form1.class.innerHTML='<option value="0" >==请选择==</option>'+originalRequest.responseText;
		  if('<*$classid*>' != ''){
				jsSelectIsExitItem(document.all.form1.class,'<*$classid*>');
			}
	 } 
}  
function deleteit(sid,stuid,clauid,groupid,schoolid,classid,pid)
{  
   

  if(confirm("删除将不能恢复")){
   window.location='/<*$controller*>/delete/sid/'+sid+'/stuid/'+stuid+'/clauid/'+clauid+'/groupid/'+groupid+'/schoolid/'+schoolid+'/classid/'+classid+'/pid/'+pid;
   }
} 
 
 function jsSelectIsExitItem(objSelect, objItemValue) {
	//alert(objSelect.options.length);
    for (var i = 0; i < objSelect.options.length; i++) {
        if (objSelect.options[i].value == objItemValue) { 
			objSelect.options[i].selected=true;
        	 break;
        }
    }
    return 1;
}  
 
 function addit(id){
	$(document).ready(function(){
	 //  $(".addnew").click(function(){ // Click to only happen on announce links
		 $("#account").val(id);
		 $('#myModal').modal('show');
	  // });
	});
				
} 
 
 
 
</script>